package CProject;

use File::Find;

sub new {
	my ( $class, @resources ) = @_;

	my $self = { 
		resources => \@resources,
	};

	bless $self, $class;

	return $self;
}

	
sub load {
	my ($this, $sub) = @_;

	my @files = ();

	foreach my $resource ( @{ $this->{resources} } ) {
		if (-d $resource ) {
			find(sub { push(@files, $File::Find::name) if ($File::Find::name =~ m/.h$/); }, $resource);
		} else {
			push(@files, $resource);
		}
	}
	
	foreach my $file (@files) {
		$sub->($file);
	}
}

1;
